package demo.controller;

import com.stylefeng.guns.core.common.persistence.model.User;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.ws.rs.GET;

/**
 * @Author: 朱媛媛
 * @Description：
 * @Date： Created in 下午 3:37 on 2018/3/14 0014.
 */
@Controller
@RequestMapping("")
public class testController {

    @RequestMapping("/{id}")
    @GET
    public ResponseEntity hello(@PathVariable int id) {
        User user = new User();
        user.setUserName("测试1");
        return ResponseEntity.ok(user);
    }

    @RequestMapping("/test")
    @GET
    public @ResponseBody User hello() {
        User user = new User();
        user.setUserName("测试1");
        return user;
    }

}
